using UseCaseManager.BO;

namespace UseCaseManager.Test.BO
{
    public class TestUtilsPackage
    {
        /// <summary>
        /// Creates a new saved Package with a random value assigned to every property
        /// </summary>
        public static Package CreateSavedPackage()
        {
            Package package = CreateUnsavedValidPackage();
            package.Save();
            return package;
        }

        /// <summary>
        /// Creates a new unsaved Package with a random value assigned to every property
        /// </summary>
        public static Package CreateUnsavedValidPackage()
        {
            Package package = new Package();
            package.PackageName = TestUtils.GetRandomString();
            package.PackageNumber = TestUtils.GetRandomString();
            package.ProjectID = TestUtilsProject.CreateSavedProject().ProjectID;
            return package;
        }
	    
        /// <summary>
        /// Creates a new unsaved Package where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static Package CreateUnsavedDefaultPackage()
        {
            Package package = new Package();
            return package;
        }
    }
}